/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.controller;

import cn.yzc.group.Save;
import cn.yzc.group.Update;
import cn.yzc.pojo.Result;
import cn.yzc.pojo.User;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>Project: SpringMVCPro - UserController</p>
 * <p>Powered by yzc On 2023-11-01 16:15:41</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@RestController
public class UserController extends BaseController{
    /**
     *
     * @param user //要验证的javabean
     * @param result //存放验证信息
     * @return
     */

    @PostMapping("/user/register")
    public Result saveUser(@Validated(value = {Update.class}) User user, BindingResult result){
        validator(result);
        System.out.println(user);
        return Result.success(user);
    }


}
